reverse a string in automation testing